<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model app\models\Showorder */

$this->title = $model->showid;
$this->params['breadcrumbs'][] = ['label' => '晒单', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="banner-view">

    <h1><?= Html::encode($this->title) ?></h1>


    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'content',
            'uname',
            [
                'attribute'=>'uimg',
                'format'=>'raw',
                'value'=>Html::img(\app\models\UploadForm::SHOW_DIR.$model->uimg,['width'=>'40px','height'=>'40px']),
            ],
            [
                'attribute'=>'showpics',
                'format' => 'raw',
                'value'=>array_reduce($model->showpics,function($str,$showpic){
                        $str.= Html::img(\app\models\UploadForm::SHOW_DIR.$showpic->url,['width'=>'40px','height'=>'40px']);
                        return $str;
                }),
                'label'=>'图片',
            ],
            [
                'attribute' => 'created_at',
                'format' => ['date', 'php:Y-m-d']
            ],
            [
                'attribute' => 'updated_at',
                'format' => ['date', 'php:Y-m-d']
            ],
        ],
    ]) ?>

</div>
